#include <stdio.h>

#include "../fn85.h"

int
main(int argc, char *argv[])
{
	char dat[16] = "hello, world!!!";
	char dat2[21];
	char dat3[sizeof(dat)];
	size_t pos = 0;
	const char *error;

	/* encode and print encoding */
	fn85_encode(dat2, dat, 4);
	dat2[20] = '\0';
	printf("%s\n", dat2);

	/* decode and check for errors */
	if (fn85_decode(dat3, dat2, 4, &pos, &error) == FN85_OKAY) {
		printf("%s\n", dat3);
	} else {
		printf("%s at %zu\n", error, pos);
	}

	return 0;
}
